package com.ieheima.zuoye3;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

public class Testy {
    public static void main(String[] args) {
        ArrayList<student> students1 = new ArrayList<>();
        ArrayList<student> students2 = new ArrayList<>();
        students1.add(new student("小王", 18));
        students1.add(new student("小张", 19));
        students1.add(new student("小李", 20));
        students1.add(new student("小刘", 20));
        students2.add(new student("小何", 21));
        students2.add(new student("小杨", 17));
        students2.add(new student("小马", 19));
        students2.add(new student("小朱", 18));


        Map<String, ArrayList<student>> map = new HashMap<>();
        map.put("201", students1);
        map.put("202", students2);
        map.forEach((k,v)->{
            System.out.println(k+"成员有：");
            v.forEach(s-> System.out.println(s.getName()+"年龄："+s.getAge()));
        });



    }
}
